package com.test.prolenders.util_prolenders;

import android.provider.Settings;
import android.text.TextUtils;

import com.test.prolenders.base_prolenders.BaseApplication_prolenders;
import com.test.prolenders.config_prolenders.Constant_prolenders;

import org.jetbrains.annotations.NotNull;


public class DecUtil_prolenders {

    private static class InnerDeviceHelper {
        private static final DecUtil_prolenders instance = new DecUtil_prolenders();
    }

    public static DecUtil_prolenders getInstance() {
        return InnerDeviceHelper.instance;
    }

    @NotNull
    public static String getPackageName() {
        String pckName = BaseApplication_prolenders.getInstant().getPackageName();
        if (TextUtils.isEmpty(pckName)) {
            pckName = Constant_prolenders.PACKAGE_NAME;
        }
        return pckName;
    }

    @NotNull
    public String getAndroidID() {
        String androidID = Settings.System.getString(BaseApplication_prolenders.getInstant().getContentResolver(), Settings.Secure.ANDROID_ID);
        if (TextUtils.isEmpty(androidID)) {
            return System.currentTimeMillis() + "";
        }
        if (androidID.contains("00000000")) {
            return System.currentTimeMillis() + "";
        }
        return androidID;
    }

}
